<%--
  Created by IntelliJ IDEA.
  User: Shinelon
  Date: 2020/11/17
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<html>
<head>
    <title>酒店预定</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/style/assets/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/style/assets/css/responsive.css">
    <script src="${pageContext.request.contextPath}/style/jquery-2.1.0.js" type="text/javascript"
            charset="utf-8"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/style/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/style/layui/layui.js"></script>
    <!--房间详情的css样式 -->
    <style>
        .best-room-info {
            height: 180px;
        }

        #left {
            float: left;
            width: 50%;
        }

        #right {
            float: right;
            width: 50%;
        }

        #bigdiv {
            width: 1100px;
            height: 380px;
            background: #FFFAE8;
        }

        #imgdiv {
            width: 380px;
            height: 380px;
            float: left;
        }

        .layui-anim {
            margin: 10px;
        }

        #img1 {
            border-radius: 500px;
            width: 360px;
            height: 360px;
        }

        #shijudiv {
            width: 150px;
            height: 350px;
            float: left;
        }

        #shiju1 {
            height: 285px;
            width: 40px;
            font-family: LiSu;
            font-size: 35px;
            margin: 10px 30px 0px 30px;
            float: left;
        }

        #shiju2 {
            height: 285px;
            width: 40px;
            font-family: LiSu;
            font-size: 35px;
            margin: 60px 0px 0px 0px;
            float: left;
        }

        #titlediv {
            width: 50px;
            margin: 60px 10px 0px 0px;
            font-family: YouYuan;
            font-weight: bold;
            font-size: 40px;
            color: dimgray;
            float: right;
        }

        #centerdiv {
            width: 450px;
            height: 370px;

            float: left;
            font-family: YouYuan;
            font-size: 25px;
            padding: 10px 0px 0px 30px;
        }

        .introduce {
            line-height: 36px;
        }

        #money {
            padding-top: 20px;
            width: 140px;
            height: 35px;
            font-size: 25px;
            color: orangered;;
            position: absolute;
            top: 300px;
            left: 950px;

        }

        #money span {
            font-size: 40px;
        }
    </style>
    <script>
        //预备函数
        $(function () {
            var syAndManDate = "";
            var flage = false;
            var initLayDate = "";
            var layer2 = "";
            showRoom();

            function showRoom() {
                //房间类型的动态展示
                $.ajax({
                    url: "/Hotel/showType",
                    type: "post",
                    dataType: "json",
                    async:false,
                    success: function (data) {
                        console.log(data)
                        console.log(data[0].name)
                        var li;
                        for (var i = 0; i < data.length; i++) {
                            li = " <li class=\"col-lg-4 col-md-4 col-sm-6 col-xs-12 best-room_li\">\n" +
                                "                        <div class=\"best-room_img\">\n" +
                                "                            <a href=\"#\"><img  class='img1' src=\"" + data[i].imgpath + "\" alt=\"\"></a>\n" +
                                "                            <div class=\"best-room_overlay\">\n" +
                                "                                <div class=\"overlay_icn\" ><a  href='javascript:void(0)' class=\"xq\"></a></div>\n" +
                                "                            </div>\n" +
                                "                        </div>\n" +
                                "                        <div class=\"best-room-info\" >\n" +
                                "                            <div class=\"best-room_t\"><a class=\"name\">" + data[i].name + "</a></div>\n" +
                                "                            <div class=\"best-room_desc\"></div>\n" +
                                "                            <div class=\"best-room_price\">\n" +
                                "                                最低价格：<span class=\"money\">" + data[i].money + "</span> / 天 <br/>\n" +
                                "                                房间数量：<span class='sum'>" + data[i].count + "</span>间<br/>" +
                                "                                <div class='sj1' style='display: none'>" + data[i].sj1 + "</div>" +
                                "                                <div class='sj2' style='display: none'>" + data[i].sj2 + "</div>" +
                                "                                <div class='id' style='display: none'>" + data[i].id + "</div>" +
                                "                            </div>\n" +
                                "                        </div>\n" +
                                "                    </li>"
                            $("#fathernav").append(li);
                        }
                    }
                })
            }

            //点击显示详情框
            $("#fathernav").on("click", ".xq", function () {
                var father = $(this).parent().parent().parent().next();
                var name = father.find(".name").html();
                var img = father.prev().find(".img1").attr("src");
                var money = father.find(".money").html();
                var sj1 = father.find(".sj1").html();
                var sj2 = father.find(".sj2").html();
                var typeid = father.find(".id").html();
                var sum = father.find(".sum").html();
                $("#titlediv").html(name);
                $("#img1").attr("src", img);
                $("#bottom-bottom").html(money);
                $("#shiju1").html(sj1);
                $("#shiju2").html(sj2);
                $.ajax({
                    url: "/Hotel/showfac",
                    data: {name: name},
                    dataType: "json",
                    async:false,
                    success: function (date) {
                        $("#centerdiv").empty();
                        for (var i = 0; i < date.length; i++) {
                            var div = date[i];
                            $("#centerdiv").append(div.inco)
                        }
                    }
                })
                //使用layui必须的函数
                layui.use(['layer', 'form', 'table', 'laydate'], function () {
                    var form = layui.form;
                    form.on('submit(add)', function (data) {
                        var gid = $("#uid").val();
                        var t = new Date().getTime()
                        const date = new Date(t);
                        var outTradeNo = "";
                        for (var i = 0; i < 4; i++) //6位随机数，用以加在时间戳后面。
                        {
                            outTradeNo += Math.floor(Math.random() * 10);
                        }
                        var orderid = date.getFullYear() + "" + (date.getMonth() + 1) + "" + date.getDate() + "" + outTradeNo + "" + gid;
                        console.log(orderid);
                        if (gid == false || gid == '') {
                            console.log("没有登录")
                            layer2.open({
                                type: 0
                                , area: ['200px', '200px']
                                , offset: '200px'
                                , closeBtn: 1
                                , fixed: true
                                , id: 'LAY_layuipro1121' //设定一个id，防止重复弹出
                                , btn: ['登录']
                                , btnAlign: 'c'
                                , moveType: 1 //拖拽模式，0或者1
                                , content: '请登录'
                                , success: function (layero) {
                                    var btn = layero.find('.layui-layer-btn');
                                    btn.find('.layui-layer-btn0').attr({
                                        href: '${pageContext.request.contextPath}/view/reception/reservelogin.jsp'
                                    })
                                }
                            })
                        } else {
                            $.ajax({
                                url: '${pageContext.request.contextPath}/addorder?roomtype=' + typeid + '&orderid=' + orderid,
                                data: data.field,
                                async:false,
                                success: function (f) {
                                    if (f == 1) {
                                        layer2.open({
                                            type: 0
                                            , area: ['200px', '200px']
                                            , offset: '200px'
                                            , fixed: true
                                            , closeBtn: false
                                            , id: 'LAY_layuipro112' //设定一个id，防止重复弹出
                                            , btn: ['关闭']
                                            , btnAlign: 'c'
                                            , moveType: 1 //拖拽模式，0或者1
                                            , content: '预定成功'
                                            , success: function (layero) {
                                                var btn = layero.find('.layui-layer-btn');
                                                btn.find('.layui-layer-btn0').click(function () {
                                                    layer.closeAll();
                                                    reset();
                                                })
                                            }
                                        })
                                    } else if (f == 0) {
                                        layer2.open({
                                            type: 0
                                            , area: ['200px', '200px']
                                            , offset: '200px'
                                            , fixed: true
                                            , id: 'LAY_layuipro11' //设定一个id，防止重复弹出
                                            , btn: ['重新数量']
                                            ,closeBtn:0
                                            , btnAlign: 'c'
                                            , moveType: 1 //拖拽模式，0或者1
                                            , content: '房间数量不足'
                                            , success: function (layero) {
                                                var btn = layero.find('.layui-layer-btn');
                                                btn.find('.layui-layer-btn0').click(function () {
                                                    $("#rcount").val("");
                                                    total();
                                                })
                                            }
                                        })
                                    }
                                }
                            })
                        }
                        return false;
                    })
                    var layer = layui.layer;
                    var layer1 = layui.layer;
                    $ = layui.jquery;
                    var laydate = layui.laydate;
                    layer2 = layui.layer;
                    layer.open({
                        type: 1
                        , title: '房间详情' //不显示标题栏
                        , closeBtn: false
                        , resize: false
                        , area: ['1100px', '480px']
                        , offset: '0px'
                        , shade: 0.8
                        , fixed: true
                        , id: 'LAY_layuipro' //设定一个id，防止重复弹出
                        , btn: ['填写订单', '关闭']
                        , btnAlign: 'c'
                        , moveType: 1 //拖拽模式，0或者1
                        , content: $("#bigdiv")
                        , yes: function (index, layero) {
                            $("#rzdate").val('');
                            $("#leavedate").val('');
                            $("#name").val('');
                            $("#tel").val('');
                            $("#sum").val(0);
                            $("#price").val(money);
                            $("#tips").html('');
                            $.ajax({
                                url: "${pageContext.request.contextPath}/findTypeById",
                                type: "post",
                                data: {typeid: typeid},
                                dataType: "json",
                                async: false,
                                success: function (f) {
                                    console.log(f)
                                    syAndManDate = f.orderMess;
                                    console.log(syAndManDate)
                                    if (syAndManDate == undefined) {
                                        initLayDate.getRiLi('');
                                    } else {
                                        //
                                        syDateAndCount = syAndManDate.srDate;
                                        //alert(JSON.stringify(syDateAndCount));
                                        //alert("已满的时间是:"+syAndManDate.manDate);
                                        initLayDate.getRiLi(syAndManDate.manDate);
                                        //获取日期  以及他们对应的剩余的房间数
                                    }
                                }
                            })
                            layer1.open({
                                type: 1
                                , title: '订单详情[' + name + ']' //不显示标题栏
                                , closeBtn: 1
                                , resize: false
                                , area: ['945px', '344px']
                                , offset: '100px'
                                , shade: 0.8
                                , fixed: true
                                , id: 'LAY_layuipr1o' //设定一个id，防止重复弹出
                                , btnAlign: 'c'
                                , moveType: 1 //拖拽模式，0或者1
                                , content: $("#order")
                                , success: function () {
                                    $("#tips").html('');
                                    var order = new Object();
                                    order.roomtype = typeid;
                                    form.on('submit(search)', function (data) {
                                        order.rzdate = $("#rzdate").val();
                                        order.leavedate = $("#leavedate").val();
                                        $("#tips").empty();
                                        synum(order);
                                        return false
                                    })
                                }
                                , end: function () {

                                }
                            })

                        }
                        // ,success: function(layero){
                        //     var btn = layero.find('.layui-layer-btn');
                        //     btn.find('.layui-layer-btn0').attr({
                        //         href: 'http://www.layui.com/'
                        //         ,target: '_blank'
                        //     });
                        // }
                    });
                    /**
                     *初始化日期组件
                     */
                    initLayDate = {
                        getRiLi: function (removedate) {
                            var tt = new Object();
                            if (removedate == "") {
                                $("#test3").empty();
                                laydate.render({
                                    elem: '#test3',
                                    min: 0,
                                    position: 'static',
                                    mark: tt,
                                    range: '~',
                                    showBottom: false,
                                    change: function (value) {
                                        //给日期赋值
                                        setValforDate(value);
                                    }
                                });
                            } else {
                                //alert(removedate);
                                $("#test3").empty();
                                for (var i = 0; i < removedate.length; i++) {
                                    var sdate = removedate[i]; //记录时间
                                    var date_array = sdate.split("-");
                                    var date_day = date_array[2]; //取日期的天比如2017-09-11取11
                                    tt[removedate[i]] = '<span style="color:#666;font-size: 14px;"><i class="layui-icon layui-icon-heart-fill" style="color:rgba(238, 143, 92, 0.8); position:absolute; left: 5px;font-size: 28px;z-index:-1;"></i>' + Number(date_day) + '</span>';
                                    //初始日期控件
                                }
                                laydate.render({
                                    elem: '#test3',
                                    min: 0,
                                    position: 'static',
                                    mark: tt,
                                    range: '~',
                                    showBottom: false,
                                    ready: function (value) {
                                        var mm = value.year + '-' + value.month + '-' + value.date;
                                        $.each(removedate, function (index, item) {
                                            var item = changeTime(item);
                                            //$('.layui-laydate table tbody').find('[lay-ymd="' + item + '"]').addClass('laydate-disabled');
                                        })
                                    },
                                    change: function (value) {
                                        flage = false;
                                        var dateTime = value.split('~');
                                        var startTime = dateTime[0].replace(/-/g, "/");
                                        var endTime = dateTime[1].replace(/-/g, "/");
                                        var s = Date.parse(startTime);
                                        var e = new Date(endTime).getTime();
                                        //如果选择的时间段之内有房间已满的情况就不允许选择
                                        $.each(removedate, function (index, item) {
                                            var disabletime = item.replace(/-/g, "/");
                                            var f = isDuringDate(s, e, disabletime);
                                            if (f) {
                                                flage = true;
                                            }
                                            //var item=changeTime(item);
                                            //$('.layui-laydate table tbody').find('[lay-ymd="' + item + '"]').addClass('laydate-disabled');
                                        })
                                        console.log(flage)
                                        if (!flage) {
                                            setValforDate(value);
                                        } else {
                                            layer2.open({
                                                type: 0
                                                , area: ['200px', '200px']
                                                , offset: '200px'
                                                , fixed: true
                                                ,closeBtn:0
                                                , id: 'LAY_layuipro11' //设定一个id，防止重复弹出
                                                , btn: ['重新选择']
                                                , btnAlign: 'c'
                                                , moveType: 1 //拖拽模式，0或者1
                                                , content: '当前时间段之内有的房间已满'
                                                , success: function (layero) {
                                                    var btn = layero.find('.layui-layer-btn');
                                                    btn.find('.layui-layer-btn0').click(function () {
                                                        initLayDate.getRiLi(syAndManDate.manDate);
                                                        $("#rzdate").val('');
                                                        $("#leavedate").val('');
                                                        $("#sum").val(0);
                                                    })
                                                }
                                            })
                                        }
                                    }
                                });
                            }
                        }
                    }
                })
            })

            /**
             * 将时间的格式更改一下
             * @param times
             * @returns {string}
             */
            function changeTime(times) {
                var time = times.split("-");
                var year = time[0];
                var month = time[1];
                if (Number(month) < 10) {
                    //将数据库中传过来的01变为1
                    month = Number(month);
                    //alert(Number(month));
                }
                var day = time[2];
                if (Number(day) < 10) {
                    //将数据库中传过来的01变为1
                    day = Number(day);
                }
                var item = year + "-" + month + "-" + day;
                return item;
            }

            //某个时间段室内是否含有这个时间如果含有就返回true 否则就false
            function isDuringDate(beginDateStr, endDateStr, dateStr) {
                var curDate = new Date(dateStr),
                    beginDate = new Date(beginDateStr),
                    endDate = new Date(endDateStr);
                if (curDate >= beginDate && curDate < endDate) {
                    return true;
                }
                return false;
            }

            function setValforDate(value) {
                var dateTime = value.split('~');
                var startTime = dateTime[0].replace(/-/g, "/");
                var endTime = dateTime[1].replace(/-/g, "/");
                var startTime1 = dateTime[0];
                var endTime1 = dateTime[1];
                var s = Date.parse(startTime);
                var e = new Date(endTime).getTime();
                //计算两个时间间隔天数
                var d = (Number(e) - Number(s)) / (1000 * 60 * 60 * 24);
                $("#d").val(d);
                if (d > 30) {
                    layer2.open({
                        type: 0
                        , area: ['200px', '200px']
                        , offset: '200px'
                        , fixed: true
                        , id: 'LAY_layuipro11' //设定一个id，防止重复弹出
                        , btn: ['重新选择']
                        , btnAlign: 'c'
                        ,closeBtn:0
                        , moveType: 1 //拖拽模式，0或者1
                        , content: '最多选择30天'
                        , success: function (layero) {
                            console.log(syAndManDate)
                            var btn = layero.find('.layui-layer-btn');
                            btn.find('.layui-layer-btn0').click(function () {
                                if (syAndManDate == undefined) {
                                    initLayDate.getRiLi('');
                                } else {
                                    //
                                    syDateAndCount = syAndManDate.srDate;
                                    //alert(JSON.stringify(syDateAndCount));
                                    //alert("已满的时间是:"+syAndManDate.manDate);
                                    initLayDate.getRiLi(syAndManDate.manDate);
                                    //获取日期  以及他们对应的剩余的房间数
                                }
                                $("#rzdate").val('');
                                $("#leavedate").val('');
                                $("#sum").val(0);
                                $("#tips").html('');
                            })
                        }
                    })
                }
                if (d < 1) {
                    layer2.open({
                        type: 0
                        , area: ['200px', '200px']
                        , offset: '200px'
                        , fixed: true
                        , id: 'LAY_layuipro111' //设定一个id，防止重复弹出
                        , btn: ['重新选择']
                        , btnAlign: 'c'
                        , moveType: 1 //拖拽模式，0或者1
                        , content: '最少选择一天'
                        ,closeBtn:0
                        , success: function (layero) {
                            var btn = layero.find('.layui-layer-btn');
                            btn.find('.layui-layer-btn0').click(function () {
                                if (syAndManDate == undefined) {
                                    initLayDate.getRiLi('');
                                } else {
                                    //
                                    syDateAndCount = syAndManDate.srDate;
                                    //alert(JSON.stringify(syDateAndCount));
                                    //alert("已满的时间是:"+syAndManDate.manDate);
                                    initLayDate.getRiLi(syAndManDate.manDate);
                                    //获取日期  以及他们对应的剩余的房间数
                                }
                                $("#rzdate").val('');
                                $("#leavedate").val('');
                                $("#sum").val(0);
                                $("#tips").html('');
                            })
                        }
                    })
                }
                $("#rzdate").val($.trim(startTime1));
                $("#leavedate").val($.trim(endTime1));
                $("#tips").html('');
                total();
            }

            //重置时间
            $("#reset").click(function () {
                reset();
            })

            //重置函数
            function reset() {
                if (syAndManDate == undefined) {
                    initLayDate.getRiLi('');
                } else {
                    //
                    syDateAndCount = syAndManDate.srDate;
                    //alert(JSON.stringify(syDateAndCount));
                    //alert("已满的时间是:"+syAndManDate.manDate);
                    initLayDate.getRiLi(syAndManDate.manDate);
                    //获取日期  以及他们对应的剩余的房间数
                }
                $("#rzdate").val('');
                $("#leavedate").val('');
                $("#rcount").val(1);
                $("#name").val('');
                $("#tel").val('');
                $("#sum").val(0);
                $("#tips").html('');
            }

            $("#rcount").keyup(function () {
                total();
            })
            $("#rcount").change(function () {
                total();
            })

            //计算总价的函数
            function total() {
                var day = $("#d").val();
                console.log("day::" + day);
                var num = $("#rcount").val();
                console.log("num::" + num);
                var price = $("#price").val();
                console.log("price::" + price);
                var sum = Number(day) * Number(price) * Number(num);
                $("#sum").val(sum);
            }

            //计算这段时间段内可以预定的房间数量
            function synum(obj) {
                $("#tips").empty();
                $.ajax({
                    url: '/Hotel/sysum',
                    data: obj,
                    async: false,
                    success: function (d) {
                        // alert(d);
                        $("#tips").html("该时间段可用的房间数量为" + d + "间")
                    },
                    error: function () {
                        $("#tips").html("请选择入住和离开时间")
                    }

                })

            }
        })
    </script>
</head>
<body>
<%--${sessionScope.name1}--%>
<%--详情框--%>
<div id="bigdiv" style="display: none">
    <div id="shijudiv">
        <div id="shiju1">
            高楼目尽欲黄昏，
        </div>
        <div id="shiju2">
            梧桐叶上萧萧雨。
        </div>
    </div>
    <div id="titlediv">
        单人间
    </div>
    <div id="centerdiv">
    </div>
    <div id="imgdiv">
        <div class="layui-anim layui-anim-scale">
            <img id="img1"/>
        </div>
    </div>
    <div id="money">
        <span id="bottom-bottom">100</span>/天
    </div>
</div>
<%--详情end--%>
<%--订单详情框--%>
<div id="order" style="display: none">
    <form class="layui-form layui-form-pane" lay-filter="add" id="addform">
        <div class="layui-row" width="100%">
            <!--栅格化 时间部分 -->
            <div class="layui-col-xs7" style="background-color: beige;width: 550px;height: 300px">
                <div class="grid-demo grid-demo-bg1">
                    <div id="test3"></div>
                    <%--                    <input id="test3">--%>
                </div>
            </div>
            <!--栅格化 表单部分 -->
            <div class="layui-col-xs5" style="background-color: beige;height: 300px">
                <%--                <input id="name" name="name" readonly autocomplete="off" class="layui-input">--%>
                <div style="display: none"><input id="uid" name="uid" readonly autocomplete="off" class="layui-input"
                                                  value="${sessionScope.name1.get("id")}"></div>
                <div style="display: none"><input id="d" name="d" readonly autocomplete="off" class="layui-input"></div>
                <div style="display: none"><input id="price" readonly autocomplete="off" class="layui-input"></div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">入住时间</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input id="rzdate" name="rzdate" readonly autocomplete="off" class="layui-input"
                                   lay-verify="required">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input id="leavedate" name="leavedate" readonly autocomplete="off" class="layui-input"
                                   lay-verify="required">
                        </div>
                    </div>
                    <input type="button" value="重置" id="reset"/>
                </div>

                <div class="grid-demo">
                    <div class="layui-form-item">
                        <label class="layui-form-label">姓名</label>
                        <div class="layui-input-inline">
                            <input type="text" id="name" name="name" maxlength="10" lay-verify="required"
                                   placeholder="入住人姓名" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux" class="name">输入用户名</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="tel" name="tel" maxlength="11" onkeyup="carNum($(this))"
                                   lay-verify="required|phone" placeholder="入住人手机号" autocomplete="off"
                                   class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux" class="">11位手机号</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">数量</label>
                        <div class="layui-input-inline">
                            <%--                            <input type="text" name="count" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" lay-verify="required|number" value="1"  autocomplete="off" class="layui-input" id="rcount">--%>
                            <input type="text" name="count" maxlength="5" onkeyup="carNum($(this))"
                                   lay-verify="required|number" value="1" autocomplete="off" class="layui-input"
                                   id="rcount">
                            <span id="tips" style="font-size: 2px;color: red"></span>
                        </div>
                        <%--                        <input type="button" value="查询数量" id="search"/>--%>
                        <button class="layui-btn layui-btn-xs" lay-submit lay-filter="search">查询数量</button>

                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">总金额</label>
                        <div class="layui-input-inline" style="width: 80px;">
                            <input id="sum" name="price" readonly autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-input-inline" style="width: 80px;">
                            <button class="layui-btn" lay-submit lay-filter="add">预定</button>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </form>
</div>
<%--表单的正则--%>
<script>
    //输入大于0的整数
    function carNum($this) {
        //输入框的值
        var value = $this.val();
        if (isNaN(value)) {//判断值是不是数字
            $this.val(1);
        } else if (value == "") {//这是当只有1位的时候，删除这个会进入这个判断，如果没有该判断，当只有一位的时候就不能删除
        } else if (value == 0) {//判断值是不是1
            $this.val(1);
        } else if (value.indexOf(".") != -1) {//判断有没有输入小数点
            $this.val(value.substring(0, value.indexOf(".")))
        }
    }

    layui.use('form', function () {
        var form = layui.form;
        form.verify({
            characters: function (v) {
                var numasc = 0;
                var charasc = 0;
                var otherasc = 0;
                for (var i = 0; i < v.length; i++) {
                    var asciiNumber = v.substr(i, 1).charCodeAt();
                    if (asciiNumber >= 48 && asciiNumber <= 57) {
                        numasc += 1;
                    }
                    if ((asciiNumber >= 65 && asciiNumber <= 90) || (asciiNumber >= 97 && asciiNumber <= 122)) {
                        charasc += 1;
                    }
                    if ((asciiNumber >= 33 && asciiNumber <= 47) || (asciiNumber >= 58 && asciiNumber <= 64) || (asciiNumber >= 91 && asciiNumber <= 96) || (asciiNumber >= 123 && asciiNumber <= 126)) {
                        otherasc += 1;
                    }
                }
                if (numasc > 0 || charasc > 0 || otherasc > 0) {
                    return "只能输入中文";
                }
            },
        })
    })
</script>
<%--订单详情框end--%>
<%--父divwrapper--%>



<div class="wrapper" style="margin:1% 3% 1% 3%;width: 94%">
    <%--导航栏--%>
        <ul class="layui-nav" lay-filter="">
            <li class="layui-nav-item "><a>欢迎光临 ${sessionScope.name1.get("name")}</a></li>
            <li class="layui-nav-item layui-this" id="llishi" style="display: none">${sessionScope.name1.get("id")}</li>
            <li class="layui-nav-item"></li>
            <img src=" ${sessionScope.name1.get("img")}" class="layui-nav-img" id="img11">
            <li class="layui-nav-item" style="float: right"><a
                    href="${pageContext.request.contextPath}/findUser?method=loginOut">退出</a></li>
            <li class="layui-nav-item" style="float: right">
                <a href="javascript:;">个人信息</a>
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
<%--                    <dd><a href="javascript:void(0)" id="xingxing">个人资料</a></dd>--%>
                    <dd><a href="javascript:void(0)" id="xinxi">修改密码</a></dd>
                    <dd><a href="javascript:void(0)" id="lishia">历史订单</a></dd>
                </dl>
            </li>
        </ul>

    <div style="height: 500px; padding: 0 10% 0 10%">
        <div class="layui-carousel" id="test111" lay-filter="test111">
            <div carousel-item="">
                <div><img src="/Hotel/style/assets/images/best-rooms/1.jpg" width="100%" height="500px"></div>
                <div><img src="/Hotel/style/assets/images/best-rooms/2.jpg" width="100%" height="500px"></div>
                <div><img src="/Hotel/style/assets/images/best-rooms/3.jpg" width="100%" height="500px"></div>
                <div><img src="/Hotel/style/assets/images/best-rooms/4.jpg" width="100%" height="500px"></div>
                <div><img src="/Hotel/style/assets/images/best-rooms/5.jpg" width="100%" height="500px"></div>
            </div>
        </div>
        <%--            <div style="float: left"><h2 class="h2">房间类型</h2></div>--%>
    </div>
    <script>
        layui.use(['carousel', 'form'], function () {
            var carousel = layui.carousel
                , form = layui.form;

            //常规轮播
            carousel.render({
                elem: '#test111'
                , arrow: 'always'
            });

            //改变下时间间隔、动画类型、高度
            carousel.render({
                elem: '#test111'
                , width: '100%'//轮播图宽度
                , height: '500px'
                , interval: 5000//间隔时间
            });

            //监听开关
            form.on('switch(autoplay)', function () {
                ins3.reload({
                    autoplay: this.checked
                });
            });

            $('.demoSet').on('keyup', function () {
                var value = this.value
                    , options = {};
                if (!/^\d+$/.test(value)) return;

                options[this.name] = value;
                ins3.reload(options);
            });

            //其它示例
            $('.demoTest .layui-btn').on('click', function () {
                var othis = $(this), type = othis.data('type');
                active[type] ? active[type].call(this, othis) : '';
            });
        });
    </script>
    <!-- chose best rooms -->
    <section class="best-room">
        <div class="container">
            <div class="title-main">
                <h2 class="h2">房间类型</h2>
            </div>
            <div class="best-room-carousel">
                <ul class="row best-room_ul" id="fathernav">
                </ul>
            </div>
        </div>
    </section>
    <!-- /choose best rooms -->
</div>
<%--历史订单--%>
<div id="lishi" style="display: none">
    <section class="best-room" style="margin: auto;width: 98%;height: 100%">

        <div class="container">
            <div class="title-main" >
                <ul class="layui-nav layui-bg-cyan layui-nav-tree layui-inline " lay-filter="demo"
                    style="margin-right: 10px;width: 100%;" id="ulfather1" >

                    <li class="layui-nav-item " id="litemp" style="display:none;">
                        <span class="a"></span><a href="javascript:;" class="b"></a>
                        <dl class="layui-nav-child" style="width: 800px">

                        </dl>
                    </li>
                </ul>


            </div>
        </div>
    </section>
</div>

<div class="layui-form"  style="display: none">
    <table class="layui-table" id="table1">
        <thead>
        <tr>
            <th>订单号</th>
            <th>预计入住时间</th>
            <th>预计离店时间</th>
            <th>房间类型</th>
            <th>房间数量</th>
            <th>房间单价</th>
            <th>订单状态</th>
            <th>订单详情</th>
        </tr>
        </thead>
        <tbody id="tfather1">

        </tbody>
        <tr id="ttemp1" style="display: none">
            <td class="orderid">订单号</td>
            <td class="rzdate">入住时间</td>
            <td class="leavedate">离开时间</td>
            <td class="type">房间类型</td>
            <td class="sum">房间数量</td>
            <td class="money">房间单价</td>
            <td class="status">订单状态</td>
            <td><input type="button" class="layui-btn" value="详情"><input type="button" class="layui-btn" value="取消"></td>
        </tr>

    </table>
</div>
<%--修改密码--%>
<div class="layui-row" id="add" style="display:none;">
    <div class="layui-col-md10">
        <form class="layui-form layui-from-pane" style="margin-top:20px" lay-filter="add" id="updateForm">
            <div class="layui-form-item" style="display: none">
                <label class="layui-form-label">id</label>
                <div class="layui-input-block">
                    <input id="id" type="text" name="id" autocomplete="off" class="layui-input"
                           value="${sessionScope.name1.get("id")}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">旧密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="pwd" required lay-verify="required|oldPassword" placeholder="请输入旧密码"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" width="100px">新密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="password" id="newPassword" required
                           lay-verify="required|newPassword1|newPassword" placeholder="请输入新密码"
                           class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">6到12个字符</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认新密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="password" required lay-verify="required|newPassword2"
                           placeholder="请确认新密码"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-form-item" style="margin-top:40px">
                    <div class="layui-input-block">
                        <button type="reset" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<%--个人质料--%>
<%--<div class="layui-row" id="daa" style="display:none;">--%>
<%--    <div id="left">--%>
<%--        <div class="layui-card">--%>
<%--            <div class="layui-card-header">可修改信息</div>--%>
<%--            <div class="layui-card-body">--%>
<%--                <div class="layui-upload">--%>
<%--                    <div class="layui-upload-list">--%>
<%--                        <img class="layui-upload-img" src="${imgpath}" id="img" style="width: 200px;height: 200px">--%>
<%--                        <p id="demoText"></p>--%>
<%--                    </div>--%>
<%--                    <button type="button" class="layui-btn" id="test1">上传图片</button>--%>
<%--                </div>--%>
<%--                <hr class="layui-bg-green">--%>
<%--                <form class="layui-form" lay-filter="updateInformation" id="updateInformation">--%>
<%--                    <input type="text" style="display: none" name="name" value="${name}">--%>
<%--                    <div class="layui-form-item layui-row" style="margin-bottom: 2px">--%>
<%--                        <label class="layui-form-label">地址</label>--%>
<%--                        <div class="layui-input-inline">--%>
<%--                            <textarea type="text" name="address" class="layui-input" lay-verify="required"></textarea>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                    <br>--%>
<%--                    <div class="layui-form-item layui-col-md-offset4" style="margin-top: 5px">--%>
<%--                        <button lay-submit lay-filter="updateBtn" class="layui-btn">修改资料</button>--%>
<%--                    </div>--%>
<%--                </form>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--    <div id="right">--%>
<%--        <div class="layui-card">--%>
<%--            <div class="layui-card-header">基本信息</div>--%>
<%--            <div class="layui-card-body">--%>
<%--                <form class="layui-form" lay-filter="information" id="information" style="margin-top: 5px">--%>

<%--                    <div class="layui-form-item layui-row" style="margin-bottom: 2px">--%>
<%--                        <label class="layui-form-label">姓名</label>--%>
<%--                        <div class="layui-input-inline">--%>
<%--                            <input type="text" name="name" class="layui-input" disabled>--%>
<%--                        </div>--%>
<%--                    </div>--%>

<%--                    <div class="layui-form-item layui-row" style="margin-bottom: 2px">--%>
<%--                        <label class="layui-form-label">身份证号码</label>--%>
<%--                        <div class="layui-input-inline ">--%>
<%--                            <input type="text" name="rolename" class="layui-input" disabled>--%>
<%--                        </div>--%>
<%--                    </div>--%>

<%--                    <div class="layui-form-item layui-row" style="margin-bottom: 2px">--%>
<%--                        <label class="layui-form-label">电话号码</label>--%>
<%--                        <div class="layui-input-inline">--%>
<%--                            <textarea type="text" name="address" class="layui-input" disabled></textarea>--%>
<%--                        </div>--%>
<%--                    </div>--%>

<%--                </form>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--</div>--%>




<div id="ruzhu" style="display:none;">
    <div class="layui-form">
        <table class="layui-table">
            <thead>
            <tr>
                <th>入住单号</th>
                <th>入住人姓名</th>
                <th>入住人手机号</th>
                <th>入住时间</th>
            </tr>
            </thead>
            <tbody id="tfather">

            </tbody>
            <tr id="ttemp" style="display: none">
                <td class="ruzhuid"></td>
                <td class="ruzhuname"></td>
                <td class="ruzhutel"></td>
                <td class="ruzhudate"></td>
            </tr>
        </table>
    </div>
</div>
<%--未住退房的弹出表单--%>
<div style="display: none;margin-top: 50px;margin-left: 50px" id="weizhuquxiaodiv">
    <form class="layui-form layui-form-pane" lay-filter="msg" id="weizhuquxiaoform">
        <div style="display: none"><input type="text" name="roomid"/></div>
        <div style="display: none"><input type="text" name="rzdate1"/></div>
        <div style="display: none"><input type="text" name="leavedate1"/></div>
        <div style="display: none"><input type="text" name="roomcode"/></div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单号</label>
            <div class="layui-input-inline">
                <input type="text"  name="orderid" readonly  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="display: none">
            <label class="layui-form-label">ruzhuid</label>
            <div class="layui-input-inline">
                <input type="text"  name="ruzhuid" readonly  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">入住时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="rzdate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">退单时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="outdate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
            <div class="layui-form-mid layui-word-aux" >订单离店日期：<span id="leave"></span></div>
        </div>

        <div class="layui-form-item">
            <div class="layui-form-mid layui-word-aux">是否超过17：00</div>
            <div class="layui-input-inline" style="width: 80px">
                <input type="checkbox" disabled lay-skin="switch" lay-text="是|否" id="istime">
            </div>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 0px">17：00后天不退</div>
        </div>

        <div class="layui-form-item">

            <label class="layui-form-label" >应退金额</label>
            <div class="layui-input-inline" style="width: 50px;margin-right: 0px">
                <input type="text" name="tsmoney"  autocomplete="off" class="layui-input" readonly>
            </div>
            <label class="layui-form-label" style="width: 50px;">元</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 20px"><span id="jiage"></span>/天 还剩<span id="syday"></span>天</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" >房间数量</label>
            <div class="layui-input-inline" style="width: 50px;margin-right: 0px">
                <input type="text" name="sum"  autocomplete="off" class="layui-input" readonly>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" name="comm"   autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-warm" lay-submit lay-filter="add">确定</button>
            </div>
        </div>
    </form>
</div>
<%--   导航栏历史订单js--%>
<script>
    function setDate(){
        var now = new Date();
        var year = now.getFullYear(); //年
        var month = now.getMonth() + 1; //月
        // var temp = new Date(year, month, 0); //当前月最后一天
        month = month >= 10 ? month : "0" + month;
        var day = now.getDate(); //日
        day = day >= 10 ? day : "0" + day;
        // var v_from = year + "-" + month + "-01";
        var v_to = year + "-" + month + "-" + day;
        return v_to;
    }
    layui.use(['element', 'layer', 'form'], function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        var layer = layui.layer;
        var layer1 = layui.layer;
        var layer2 = layui.layer;
        var layer3 = layui.layer;
        var layer4 = layui.layer;
        var form = layui.form;
        var idd = '${sessionScope.name1.get("id")}';
        //监听导航点击
        element.on('nav(demo)', function(elem){
            var f = elem.next();
            var time = elem.text();
            var id = $("#llishi").html();
            var table = $("#table1");
            $.ajax({
                url: '/Hotel/reserve/selectorderByTime',
                data: {time:time,id:id},
                dataType: 'json',
                async: false,
                success:function (d) {
                    console.log(d)
                    $("#tfather1").empty();
                    for (var i = 0; i < d.length; i++) {
                        var li = $("#ttemp1").clone(true);
                        li.attr("id", "");
                        li.attr("style", "");
                        li.find(".orderid").html(d[i].orderid);
                        li.find(".rzdate").html(d[i].rzdate);
                        li.find(".leavedate").html(d[i].leavedate);
                        li.find(".type").html(d[i].typename);
                        li.find(".sum").html(d[i].count);
                        li.find(".money").html(d[i].money);
                        if (d[i].status == 0 && d[i].iszhugou == 0) {
                            li.find(".status").html("已付款")
                            li.find("input[value='详情']").hide();
                        } else if (d[i].status == 0 && d[i].iszhugou ==1) {
                            li.find(".status").html("正在入住")
                            li.find("input[value='取消']").hide();

                        } else if (d[i].status == 1) {
                            li.find(".status").html("订单已全部入住")
                            li.find("input[value='取消']").hide();

                        } else if (d[i].status == 4) {
                            li.find(".status").html("已退单")
                            li.find("input[value='取消']").hide();
                            li.find("input[value='详情']").hide();

                        } else if (d[i].status == 2) {
                            li.find(".status").html("订单已完成")
                            li.find("input[value='取消']").hide();
                        }
                       $("#tfather1").append(li);
                    }
                },
                error:function () {
                    alert("错误")
                }
            })
            f.append(table);
        });


        //个人信息
        $("#xingxing").click(function () {
            if (idd != '') {
                layer.open({
                    title: '添加'
                    , type: 1
                    , content: $("#daa")
                    , offset: '0px'
                    , moveOut: true
                    , resize: false
                    ,id:'bbb'
                    , area: ['1160px', '580px']
                })
            } else {
                alert("请先登录!");
            }
        });


        //修改密码

        $("#xinxi").click(function () {
            if (idd != '') {
                layer.open({
                    title: '添加'
                    , type: 1
                    , content: $("#add")
                    , offset: '0px'
                    , moveOut: true
                    , resize: false
                    ,id:'bbb'
                    , area: ['500px', '400px']
                })
            } else {
                alert("请先登录!");
            }
        });
        var staffPassword = '${sessionScope.name1.get("pwd")}';
        form.verify({
            oldPassword: function (value) { //value：表单的值、item：表单的DOM对象

                if (staffPassword != value) {
                    return '旧密码不正确';
                }
            }
            , newPassword1: function (value) { //value：表单的值、item：表单的DOM对象
                if (staffPassword == value) {
                    return '不能和更改前密码一致';
                }
            }
            , newPassword: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
            , newPassword2: function (value, item) { //value：表单的值、item：表单的DOM对象
                if ($("#newPassword").val() != value) {
                    return '两次输入密码不一致';
                }
            }
        });
        //监听提交
        form.on('submit(formDemo)', function (data) {
            $.ajax({
                url: '${pageContext.request.contextPath}/findUser?method=update',
                type: 'post',
                async: false,
                data: {id: $("#id").val(), pwd: staffPassword, newpwd: $("#newPassword").val()},
                success: function (result) {
                    if (result != 0) {
                        alert("修改成功,请重新登录!");
                        window.location.href = "${pageContext.request.contextPath}/findUser?method=loginOut";
                    } else {
                        // toastr.error('修改密码失败');
                        alert("修改失败！");
                    }
                    <%--window.location.href = "${pageContext.request.contextPath}/view/login/login.jsp";--%>
                },
            });
            return false;
        });

        //订单信息
        $("#lishia").click(function () {
            var tel = $("#llishi").html();
            layer1.open({
                type: 1,
                content: $("#lishi")
                , offset: '100px'
                , title: '历史订单'
                , area: ['1200px', '800px']
                ,id:"ccc"
                , success: function () {
                    $.ajax({
                        url: '/Hotel/reserve/selectOrderByTel',
                        data: {tel: tel},
                        dataType: 'json',
                        async: false,
                        success: function (d) {
                            console.log(d);

                            $("#ulfather1 li").not(":first").remove();
                            for (var i = 0; i < d.length; i++) {
                                var li = $("#litemp").clone(true);
                                li.attr("id", "");
                                li.attr("style", "");
                                li.find(".a").html("下单时间：")
                                li.find(".b").html(d[i].createtime)
                                $("#ulfather1").append(li);
                            }
                        },
                        error: function () {
                            alert("111")
                        }
                    })
                },
                end:function () {
                    window.location.reload();
                }
            })
            $("#ulfather1").on('click', 'input[value="详情"]', function () {
                var f = $(this).parent().parent();
                var ordrid = f.find(".orderid").html();
                $.ajax({
                    url: '/Hotel/reserve/selectruzhuid',
                    data: {orderid: ordrid},
                    dataType: 'json',
                    async: false,
                    success: function (data) {
                        layer2.open({
                            type: 1,
                            content: $("#ruzhu")
                            , offset: '200px'
                            , title: '订单详情'
                            , area: ['600px', '610px']
                            ,id:'aaa'
                            , success: function () {
                                $("#tfather").empty();
                                for (var i = 0; i < data.length; i++) {
                                    var li = $("#ttemp").clone(true);
                                    li.attr("id", "");
                                    li.attr("style", "");
                                    li.find(".ruzhuid").html(data[i].ruzhuid)
                                    li.find(".ruzhuname").html(data[i].name)
                                    li.find(".ruzhutel").html(data[i].tel)
                                    li.find(".ruzhudate").html(data[i].rzdate1)
                                    $("#tfather").append(li);
                                }
                            }
                        })
                    }
                })
            })
        })
        $("#tfather1").on('click','input[value="取消"]',function () {

            var f= $(this).parent().parent();
            var orderid = f.find(".orderid").html();
            let date = setDate();
            var leave = f.find(".leavedate").html();
            var rz = f.find(".rzdate").html();
            var leave1 = new Date(leave).getTime();
            var rz1 = new Date(rz).getTime();
            var ndate = new Date(date).getTime();
            var d ="";
            $("#leave").html(leave);
            var ndatehour = new Date().getHours();
            var sum ='';
            var number = f.find(".sum").html()
            var money = f.find(".money").html()
            $("#jiage").html(money);
            if(date < rz) {
                d = (Number(leave1) - Number(rz1)) / (1000 * 60 * 60 * 24);
                sum = Number(d) * Number(money) * Number(number);
            }
            else if( leave > date  && date >= rz) {
                d = (Number(leave1) - Number(ndate)) / (1000 * 60 * 60 * 24);
                if(ndatehour > 14){
                    $("#istime").attr("checked",true);
                    sum = (Number(d)-1) * Number(money) * Number(number)+(Number(money)*0*Number(number));
                }else {
                    $("#istime").attr("checked",false);
                    sum = Number(d) * Number(money) * Number(number);
                }
            }else if( leave == date ){
                d = 0;
                sum = 0;
            }
            $("#syday").html(d);
            layer.open({
                title:'取消订单(未入住)',
                type:1,
                offset:'0px',
                content:$("#weizhuquxiaodiv"),
                area:['600px','550px'],
                success:function () {
                    form.val('msg', {
                        "orderid":orderid,
                        "outdate":date,
                        "sum":number,
                        "tsmoney":sum,
                        "rzdate":rz
                    });
                }
            })
            var yitui ="";
            //查看该订单在退房表里的条数
            $.ajax({
                url:'/Hotel/qiantai/orderstatus',
                data:{orderid:orderid},
                async:false,
                success:function (d) {
                    yitui = d.tuifang;
                }
            });
            //还有几个房间的数量没退
            var tuicount = Number(number) - Number(yitui) ;
            form.on('submit(add)',function (data) {
                $.ajax({
                    url:"/Hotel/qiantai/addtuifang?tuicount="+tuicount,
                    data:data.field,
                    async:false,
                    success:function(d){
                        layer.closeAll();
                        $.ajax({
                            url:"/Hotel/qiantai/changeorder",
                            data:{orderid : orderid},
                            async:false,
                            success:function (D) {
                            },error:function () {
                                alert("cuo")
                            }
                        })
                        window.location.reload();
                    },
                    error:function () {
                        layer.closeAll();
                        alert("操作失败");
                    }
                })
                return false;
            })
        })

    });
</script>
<!-- Scripts -->
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/tether.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/moment.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/jquery.smartmenus.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/jquery.parallax.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/jquery.shuffle.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/owl.carousel.min.js"></script>
<!---<script type="text/javascript" src="http://ditu.google.cn/maps/api/js"></script>--->
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/map.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/style/assets/js/main.js"></script>
<!-- /Scripts -->
</body>
</html>
